LD=ld
CC=gcc
MV=mv
RM=rm
CFLAGS=-fno-builtin -fno-pic -static -fno-strict-aliasing -Wall -ggdb -m32 -fno-omit-frame-pointer -nostdinc -fno-stack-protector -I../h
objects=start.o swtch.o trap.o main.o malloc.o idt.o pic.o tty.o cns.o proc.o conf.o sig.o slp.o prf.o clk.o ide.o bio.o 
objects+=string.o sys1.o sys2.o sys3.o syscall.o fs.o swap.o time.o alloc.o page.o
pkzd: start.S swtch.S trap.S main.c malloc.c idt.c pic.c tty.c cns.c  proc.c conf.c sig.c slp.c prf.c clk.c ide.c bio.c \
	string.c sys1.c sys2.c sys3.c syscall.c fs.c swap.c time.c alloc.c page.c 
	$(CC) $(CFLAGS) -c start.S
	$(CC) $(CFLAGS) -c swtch.S	
	$(CC) $(CFLAGS) -c trap.S	
	$(CC) $(CFLAGS) -c main.c	
	$(CC) $(CFLAGS) -c malloc.c	
	$(CC) $(CFLAGS) -c pic.c	
	$(CC) $(CFLAGS) -c idt.c	
	$(CC) $(CFLAGS) -c tty.c	
	$(CC) $(CFLAGS) -c cns.c	
	$(CC) $(CFLAGS) -c proc.c	
	$(CC) $(CFLAGS) -c conf.c	
	$(CC) $(CFLAGS) -c sig.c	
	$(CC) $(CFLAGS) -c prf.c	
	$(CC) $(CFLAGS) -c clk.c	
	$(CC) $(CFLAGS) -c ide.c	
	$(CC) $(CFLAGS) -c bio.c	
	$(CC) $(CFLAGS) -c string.c	
	$(CC) $(CFLAGS) -c sys1.c	
	$(CC) $(CFLAGS) -c sys2.c	
	$(CC) $(CFLAGS) -c sys3.c	
	$(CC) $(CFLAGS) -c slp.c	
	$(CC) $(CFLAGS) -c fs.c	
	$(CC) $(CFLAGS) -c time.c	
	$(CC) $(CFLAGS) -c syscall.c	
	$(CC) $(CFLAGS) -c swap.c
	$(CC) $(CFLAGS) -c time.c
	$(CC) $(CFLAGS) -c alloc.c
	$(CC) $(CFLAGS) -c page.c 
	$(LD) -T kern.ld -o $@ $(objects) 
	$(MV) $@ ./..
clean:
	$(RM) -f pkzd $(objects) *.o
